<div class="am-u-sm-12 widget" style="margin:10px">
	<div class="am-u-sm-12">
		<form class="am-form-inline tpl-form-border-form" method="get" action="">
			<div class="am-form-group am-u-sm-3 cl-p">
				<label class="am-u-sm-4 am-form-label am-text-truncate">订单号:</label>
				<div class="am-u-sm-8 cl-p">
					<input type="text" class="am-form-field" name="order_no" placeholder="请输入订单号">
				</div>
			</div>
			<div class="am-form-group am-u-sm-3 cl-p">
				<label class="am-u-sm-4 am-form-label am-text-truncate">订单类别:</label>
				<div class="am-u-sm-8 cl-p">
					<select name="order_type" style="height: 33px;">
						<option value="0">所有订单</option>
						<option value="1">公务订单</option>
						<option value="2">企业订单</option>
					</select>
				</div>

			</div>
			<div class="am-form-group am-u-sm-3">
				<div class="am-u-sm-4 cl-p">
					<select style="height: 33px;">
						<option value="1">用车人</option>
						<option value="2">预定人</option>
					</select>
				</div>
				<div class="am-u-sm-8 cl-p">
					<input type="text" class="tpl-form-no-bg" name="phone" placeholder="请输入名称/电话">
				</div>
			</div>
			
			<div class="am-form-group am-u-sm-3">
				<button type="submit" class="am-btn am-btn-sm am-btn-primary am-radius" style="margin-top: -2px;">查询</button>
				<button type="button" id="more" class="am-btn am-btn-sm am-btn-secondary am-radius" style="margin-top: -2px;">更多查询条件</button>
			</div>
			<div id="showmore" style="display: none;">
				<div class="am-u-sm-12" style="padding:5px 0;">
					<div class="am-u-sm-3 cl-p" >
						<label class="am-u-sm-4 am-form-label am-text-truncate ">用车时间:</label>
						<div class="am-u-sm-8 cl-p">
							<div class="am-u-sm-6 cl-p">
								<input type="text" class="am-form-field tpl-form-no-bg"  placeholder="用车日期起始" data-am-datepicker="" readonly="">
							</div>
							<div class="am-u-sm-6 cl-p">
								<input type="text" class="am-form-field tpl-form-no-bg" placeholder="用车日期结束" data-am-datepicker="" readonly="">
							</div>
						</div>
					</div>
					<div class="am-u-sm-3 cl-p" >
						<label class="am-u-sm-4 am-form-label am-text-truncate ">申请时间:</label>
						<div class="am-u-sm-8 cl-p">
							<div class="am-u-sm-6 cl-p">
								<input type="text" class="am-form-field tpl-form-no-bg" placeholder="申请日期起始" data-am-datepicker="" readonly="">
							</div>
							<div class="am-u-sm-6 cl-p">
								<input type="text" class="am-form-field tpl-form-no-bg" placeholder="申请日期结束" data-am-datepicker="" readonly="">
							</div>
						</div>
					</div>
					<div class="am-u-sm-6 cl-p" >&nbsp;</div>
				</div>
			</div>
		</form>
	</div>
	<div class="am-u-sm-12" style="padding:20px 0 0 20px;">
		
		<div class="am-tabs" >
			<ul class="am-tabs-nav am-nav am-nav-tabs">
				<li class={:input('param.order_state')==0?'am-active':" "}>
					<a href="{:url('index',['order_state'=>0])}">待用车</a>
				</li>
				<li class={:input('param.order_state')==1?'am-active':" "}>
					<a href="{:url('index',['order_state'=>1])}">已派车</a>
				</li>
				<li class={:input('param.order_state')==2?'am-active':" "}>
					<a href="{:url('index',['order_state'=>2])}">接驾中</a>
				</li>
				<li class={:input('param.order_state')==3?'am-active':" "}>
					<a href="{:url('index',['order_state'=>3])}">已到达出发地</a> 
				</li>
				<li class={:input('param.order_state')==4?'am-active':" "}>
					<a href="{:url('index',['order_state'=>4])}">已到达目的地</a>
				</li>
				<li class={:input('param.order_state')==5?'am-active':" "}>
					<a href="{:url('index',['order_state'=>5])}">待支付</a>
				</li>
				<li class={:input('param.order_state')==6?'am-active':" "}>
					<a href="{:url('index',['order_state'=>6])}">待评价</a>
				</li>
				<li class={:input('param.order_state')==7?'am-active':" "}>
					<a href="{:url('index',['order_state'=>7])}">已完成</a>
				</li>
				<li class={:input('param.order_state')==8?'am-active':" "}>
					<a href="{:url('index',['order_state'=>8])}">已取消</a>
				</li>
				<li class={:input('param.order_state')==9?'am-active':" "}>
					<a href="{:url('index',['order_state'=>9])}">已终止</a>
				</li>
			</ul>
			<div class="am-tabs-bd" style="border: 0 ;">
				{if input('param.order_state')==0||!input('param.order_state')}
				<div >
					<div style="padding: 10px;" class="am-u-sm-12">
						<div><button style="float: right;" type="button" class="am-btn am-btn-default am-radius am-btn-xs" style="margin-top: -2px;">导出文件</button></div>
						<table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-text-nowrap">
							<thead>
								<tr>
									<th>订单号</th>
									<th>申请时间</th>
									<th>开始时间(不选择默认即时)</th>
									<th>车辆类型</th>
									<!--<th>订单类型</th>-->
									<th>订单类别</th>
									<th>乘客</th>
									<th>出发地</th>
									<th>目的地</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{foreach $list as $key => $item}
								<tr class="gradeX" data-id='{$item.order_id}'>
									<td><a href="{:url('detail',['order_id'=>$item.order_id])}">{$item.order_no}</a></td>
									<td>{$item.apply_time}</td>
									<td>{$item.orders_time}</td>
									<td>{if $item.use_type==0}
										优选型
										{elseif $item.use_type==1/}
										舒适型
										{elseif $item.use_type==2/}
										豪华型
										{elseif $item.use_type==3/}
										大巴
										{elseif $item.use_type==4/}
										小巴
										{elseif $item.use_type==5/}
										中巴
										{elseif $item.use_type==6/}
										执法车
										{/if}
									</td>
									<td>{$item.order_type==1?'公务订单':'企业订单'}</td>
									<!--<td>{$item.order_type}</td>-->
									<td>{$item.passenger_name}</td>
									<td>{$item.departure}</td>
									<td>{$item.destination}</td>
									<td>{$item.order_state}</td>
									<td>
										<div class="tpl-table-black-operation">
											<a href="{:url('dispatch',['order_id'=>$item.order_id])}">
												<i class="am-icon-pencil"></i> 派车
											</a>
											<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
												<i class="am-icon-pencil"></i> 删除
											</a>
										</div>
									</td>
								</tr>
								{/foreach}

							</tbody>
						</table>
						<div class="am-u-lg-12 am-cf">

							<div class="am-fr">
								{$pager}
							</div>
						</div>
					</div>

				</div>
				{elseif input('param.order_state')==1||input('param.order_state')==2/}
				<div >
					<div style="padding: 10px;" class="am-u-sm-12">
						<div><button style="float: right;" type="button" class="am-btn am-btn-default am-radius am-btn-xs" style="margin-top: -2px;">导出文件</button></div>
						<table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-text-nowrap">
							<thead>
								<tr>
									<th>订单号</th>
									<th>计划出发时间</th>
									<th>到达出发地时间</th>
									<th>实际出发时间</th>
									<th>订单类型</th>
									<th>乘客</th>
									<th>司机</th>
									<th>出发地</th>
									<th>目的地</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{foreach $list as $key => $item}
								<tr class="gradeX" data-id='{$item.order_id}'>
									<td><a href="{:url('detail',['order_id'=>$item.order_id])}">{$item.order_no}</a></td>
									<td>{$item.name}</td>
									
									<td>{$item.arrive_time}</td>
									<td>{$item.ride_time}</td>
									<td>{$item.order_type==1?'公务订单':'企业订单'}</td>
									<td>{$item.passenger}</td>
									<td>{$item.driver}</td>
									<td>{$item.departure}</td>
									<td>{$item.destination}</td>
									<td>
										<div class="tpl-table-black-operation">
											<a class="showmap" data-method="showmap" href="javascript:;">
												<i class="am-icon-map"></i> 轨迹
											</a>
											<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
												<i class="am-icon-pencil"></i> 删除
											</a>
										</div>
									</td>
								</tr>
								{/foreach}

							</tbody>
						</table>
						<div class="am-u-lg-12 am-cf">

							<div class="am-fr">
								{$pager}
							</div>
						</div>
					</div>

				</div>
				{else/}
				<div >
					<div style="padding: 10px;" class="am-u-sm-12">
						<div><button style="float: right;" type="button" class="am-btn am-btn-default am-radius am-btn-xs" style="margin-top: -2px;">导出文件</button></div>
						<table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-text-nowrap">
							<thead>
								<tr>
									<th>订单号</th>
									<th>计划出发时间</th>
									<th>到达出发地时间</th>
									<th>实际出发时间</th>
									<th>实际到达时间</th>
									<th>订单类型</th>
									<th>乘客</th>
									<th>司机</th>
									<th>里程</th>
									<th>耗时</th>
									<th>费用</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{foreach $list as $key => $item}
								<tr class="gradeX" data-id='{$item.order_id}'>
									<td><a href="{:url('detail',['order_id'=>$item.order_id])}">{$item.order_no}</a></td>
									<td>{$item.name}</td>
									<td>{$item.arrive_time}</td>
									<td>{$item.ride_time}</td>
									<td>{$item.arrive_time}</td>
									<td>{$item.order_type==1?'公务订单':'企业订单'}</td>
									<td>{$item.passenger}</td>
									<td>{$item.driver}</td>
									<td>{$item.mileage}</td>
									<td>{$item.time}</td>
									<td>{$item.settlement_price}</td>
									<td>
										<div class="tpl-table-black-operation">
											<a data-method="showmap">
												<i class="am-icon-map"></i> 轨迹
											</a>
											<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
												<i class="am-icon-pencil"></i> 删除
											</a>
										</div>
									</td>
								</tr>
								{/foreach}

							</tbody>
						</table>
						<div class="am-u-lg-12 am-cf">

							<div class="am-fr">
								{$pager}
							</div>
						</div>
					</div>

				</div>
				{/if} 
			</div>
		</div>
	</div>

</div>

<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>